import { useEffect, useState } from "react"
import { getChannelAPI } from '@/apis/article'

function useChannel() {
    //获取频道列表
    const [channelList, setChannelList] = useState([])

    const getChannelList = async () => {
        const res = await getChannelAPI()
        setChannelList(res.data.channels)
    }
    useEffect(() => {
        getChannelList()
    }, [])
    return {
        channelList
    }
}

export { useChannel }